Skip to content

Fix: support missing OpenAI env vars#72

Merged
dacharyc merged 1 commit intomainfrom
fix/openai-missing-env-vars
Apr 19, 2026
Merged

Fix: support missing OpenAI env vars#72
dacharyc merged 1 commit intomainfrom
fix/openai-missing-env-vars

Conversation

@dacharyc
Copy link
Copy Markdown
Member

@dacharyc dacharyc commented Apr 19, 2026

What this PR does

Issue #70 ran into an issue using a project ID and organization ID with the OpenAI LLM-as-judge provider. In my own testing here, I was not using either env var and simply hadn't supported them. This PR adds support for:

  • OPENAI_ORG_ID - sent as a OpenAI-Organization header
  • OPENAI_PROJECT_ID - sent as OpenAI-Project header

This covers the three auth headers described in the OpenAI Developers Authentication documentation, and matches the OpenAI Python SDK env var naming.

How to test

The PR adds new tests in judge/client_test.go specifically for cases where:

  • The env vars are present or omitted
  • If a non-OpenAI baseURL is provided, as when using the API with Ollama, we should not send the headers even if the env vars are set

Checklist

  • Tests pass locally (go test -race ./... -count=1)
  • Lint passes locally (golangci-lint run)
  • New functionality includes tests
  • Breaking changes are noted above (if any)

@dacharyc dacharyc merged commit 0256ab5 into main Apr 19, 2026
3 checks passed
@dacharyc dacharyc deleted the fix/openai-missing-env-vars branch April 19, 2026 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant